require'cmp'.setup {
  sources = {
    { name = 'nvim_lsp' }
  }
}

require("mason").setup({
  ui = {
      icons = {
          package_installed = "✓",
          package_pending = "➜",
          package_uninstalled = "✗"
      },
  },
  github = {
    download_url_template = "https://ay1.us/https://github.com/%s/releases/download/%s/%s",
  },
})

-- 以下内容修改成自己的语言环境
require("mason-lspconfig").setup({
  ensure_installed = {
    -- bash
    'bashls',
    --,python
    'pyright',
    -- json
    'jsonls',
    -- html
    'html',
    -- toml
    'taplo',
    -- 'eslint',
    'vuels',
  },
  automatic_installation = true,
})

-- lsp模板
-- require("lspconfig").<YOUR-LANGUAGE-SERVER>.setup {
  -- capabilities = capabilities,
-- }

local capabilities = require('cmp_nvim_lsp').default_capabilities()

-- require('lspconfig').quick_lint_js.setup {}

require("lspconfig").bashls.setup {
  capabilities = capabilities,
}

require("lspconfig").pyright.setup {
  capabilities = capabilities,
}

require("lspconfig").jsonls.setup {
  capabilities = capabilities,
}

require("lspconfig").html.setup {
  capabilities = capabilities,
}

require("lspconfig").vimls.setup {
  capabilities = capabilities,
}

require("lspconfig").taplo.setup {
  capabilities = capabilities,
}

--[[ require("lspconfig").eslint.setup {
  capabilities = capabilities,
} ]]

require("lspconfig").vuels.setup {
  capabilities = capabilities,
}
